package cn.edu.hziee;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class RefreshServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html;charset=utf-8");
//        response.getWriter().write("注册成功，2秒后跳转到百度首页");
//        response.setHeader("Refresh","2;URL=http://www.baidu.com");   /*跳转*/
        response.setHeader("Refresh","2");  /*当前*/
        response.getWriter().println(new java.util.Date());
    }
}
